<?php
class member{
	public function init($params=array()){
		$this->db=$this->yum->library('mysql');
		$this->prefix=$this->yum->vars('app','prefix');
	}
    public function GMember($params=array()){
    	return $this->db->select($this->prefix.'member AS A',$params);
    }
    public function GMemberFull($params=array()){
    	$table=$this->prefix.'member AS A';
    	$table.=' LEFT JOIN '.$this->prefix.'role AS B ON A.role=B.id';
    	$table.=' LEFT JOIN '.$this->prefix.'information AS C ON A.id=C.member';;
    	if(!isset($params['select'])){
    		$params['select']='A.id,A.mail,A.visits,A.ip AS lastip,A.date AS lastdate,B.name AS role,C.name,C.IDcard,C.phone,C.msn,C.qq,C.money,C.frozen,C.date,C.ip,A.locked';
    	}
    	return $this->db->select($table,$params);
    }
	public function IMember($params,$mode=0){
		return $this->db->insert($this->prefix.'member',$params,$mode);
	}
	public function UMember($params){
		return $this->db->update($this->prefix.'member',$params);
	}
}
?>